package util;

import java.util.ArrayList;
import java.util.List;

/**
 *
 */
public class ConnectionParams {
    
    public static final String ip1 = "192.168.0.243";
    
    public static final String port1 = "14100";
    
    public static final String ip2 = "192.168.0.243";
    
    public static final String port2 = "14200";
    
    public static final String ip3 = "192.168.0.243";
    
    public static final String port3 = "14300";
    
    public static final String database = "test";
    
    public static final String user = "test";
    
    public static final String password = "huawei123.";

    public static final String clientHost = "192.168.0.28";

    public static final String driver = "opengauss";
    
    private final static String URL = "jdbc:opengauss://192.168.0.243:14100,192.168.0.243:14200,192.168.0.243:14300/test";
    
    public static String getUrlWithCluster() {
        String host1 = ip1 + ":" + port1;
        String host2 = ip2 + ":" + port2;
        String host3 = ip3 + ":" + port3;
        return "jdbc:opengauss://" + host1 + "," + host2 + "," + host3 + "/" + database + "?";
    }
    
    public static String getQuickAutoBalanceParams() {
        return "autoBalance=leastconn&enableQuickAutoBalance=true&minIdleTimeBeforeTerminal=10&loggerLevel=INFO";
    }

    public static List<String> getHosts() {
        List<String> list = new ArrayList<>();
        list.add(ip1 + ":" + port1);
        list.add(ip2 + ":" + port2);
        list.add(ip3 + ":" + port3);
        return list;
    }
    
}
